Add /count command - #3446
Merged
Merged
Add /count command#3446
/count command#3446Conversation
Contributor
|
Its still a draft, but would it maybe make sense to give it an optional value to say for which block you want to know the count? |
Collaborator
Author
|
Yeah its doable, tho since this is primarily aimed at humans, I think its rare they will be looking for very specific block and they will care to write down the Id. |
IntegratedQuantum
requested changes
Aug 8, 2026
IntegratedQuantum
left a comment
Member
There was a problem hiding this comment.
Very useful, thanks for implementing
| } else { | ||
| var iterator = context.iterator(); | ||
| while (iterator.next()) |next| { | ||
| user.sendMessage("#ffff00{s} #ffffff{d}", .{(Block{.typ = next.key_ptr.*, .data = 0}).id(), next.value_ptr.*}); |
Member
There was a problem hiding this comment.
Could you print them sorted by count, descending?
Collaborator
Author
Member
There was a problem hiding this comment.
Oh that looks so much nicer!
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
IntegratedQuantum
requested changes
Aug 9, 2026
Co-authored-by: IntegratedQuantum <43880493+IntegratedQuantum@users.noreply.github.com>
IntegratedQuantum
approved these changes
Aug 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds trivial
/countcommand implementation.Currently based on hash map, when we swap to palette storage for blueprints (#1896) we can reduce it to just printing palette entries.
It could be useful to get also entity counts and differentiate blocks with different data values, all out of scope, material for future improvements.
Resolves: #3043